<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="Comments.aspx.cs" Inherits="UserGeneratedContent_Comments" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="phActions" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="phSubMenu" Runat="Server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
        Width="75px">
        <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
            style="border: 0px;" />
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="dsComments" GridLines="None" AllowPaging="True" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCommand="RadGrid1_ItemCommand" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" AllowAutomaticDeletes="true">
        <MasterTableView DataSourceID="dsComments" DataKeyNames="Id,ConcurencyId">
            <RowIndicatorColumn Visible="False">
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn Resizable="False" Visible="False">
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <PagerStyle Mode="Slider" />
            <Columns>
                <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName" ReadOnly="True"
                    SortExpression="UserName" UniqueName="UserName">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Created" DataType="System.DateTime" HeaderText="Created"
                    ReadOnly="True" SortExpression="Created" UniqueName="Created">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Title" HeaderText="Title" SortExpression="Title"
                    UniqueName="Title">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Comment" HeaderText="Comment" SortExpression="Comment"
                    UniqueName="Comment">
                </telerik:GridBoundColumn>
                <telerik:GridCheckBoxColumn DataField="Reviewed" DataType="System.Boolean" HeaderText="Reviewed"
                    SortExpression="Reviewed" UniqueName="Reviewed">
                </telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn DataField="Reported" DataType="System.Boolean" HeaderText="Reported"
                    SortExpression="Reported" UniqueName="Reported">
                </telerik:GridCheckBoxColumn>
                <telerik:GridCheckBoxColumn DataField="Suspended" DataType="System.Boolean" HeaderText="Suspended"
                    SortExpression="Suspended" UniqueName="Suspended">
                </telerik:GridCheckBoxColumn>
                <telerik:GridTemplateColumn UniqueName="TemplateColumn">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkApprove" CommandName="Approve" Text="Approve" OnClientClick="return confirm('Are you sure that you want to approve this comment?');" runat="server" Visible='<%# !(bool)Eval("Reviewed") || (bool)Eval("Suspended") %>' CommandArgument='<%# Container.ItemIndex %>'/>
                        <asp:LinkButton ID="lnkSuspend" CommandName="Suspend"  Text="Suspend" OnClientClick="return confirm('Are you sure that you want to suspend this comment?');" runat="server" Visible='<%# !(bool)Eval("Suspended") %>' CommandArgument='<%# Container.ItemIndex %>'/>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridButtonColumn CommandName="Delete" ConfirmText="Are you sure you want to delete this comment?" Text="Delete" UniqueName="column1"></telerik:GridButtonColumn>
            </Columns>
            <EditFormSettings>
                <PopUpSettings ScrollBars="None" />
            </EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>
    <acms:DownloadingGrid ID="gridDowload" DataSourceID="dsComments" FileName="UserComments" runat="server">
        <Columns>
            <acms:DownloadGridField DataField="UserName" Format="" HeaderText="Username" />
            <acms:DownloadGridField DataField="Created" Format="" HeaderText="Created" />
            <acms:DownloadGridField DataField="Title" Format="" HeaderText="Title" />
            <acms:DownloadGridField DataField="Comment" Format="" HeaderText="Comment" />
            <acms:DownloadGridField DataField="IPAddress" Format="" HeaderText="IPAddress" />
            <acms:DownloadGridField DataField="Reviewed" Format="" HeaderText="Reviewed" />
            <acms:DownloadGridField DataField="Reported" Format="" HeaderText=" Reported" />
            <acms:DownloadGridField DataField="Suspended" Format="" HeaderText="Suspended" />
        </Columns>
    </acms:DownloadingGrid>
    <acms:UserPostCommentDataSource ID="dsComments" runat="server"
        EnablePaging="False" OnSelectData="dsComments_SelectData">
    </acms:UserPostCommentDataSource>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <br />
</asp:Content>

